 Building a Report

 Where do you want to begin?

  I want to build a report from scratch.

  I want to enhance my report with graphics and OLE objects.

  Topical Index to Personal Trainer


 Building a report
from scratch

Where do you want to start?

Report design and setup

Adding, moving, and changing text

Adding, moving, and changing fields

Sorting, grouping, and summarizing data


 Report design
and setup

How do I:

Create margins

Insert blank lines

Delete blank lines

Insert page headers and footers

Insert page numbers and other special fields

Hide parts of the report when printing

Select page orientation and paper size

Export my report


 Adding, moving,
and changing text

 How do I:

Insert text (titles, labels, etc.)

Select text (to delete, change the font, etc.)

Align text with fields

Change text fonts


 Adding, moving,
and changing fields

How do I:

Insert fields

Select fields to move, format, etc.

Space fields

Change field fonts

Highlight fields with borders and drop shadows

Center text field values


 Sorting, grouping, and
summarizing data

How do I:

Group data

Summarize grouped data

Create group headers

Sort my data

Select records and groups I want included on my report.

Group my data in a CrossTab report


Enhancing a report with graphics
 Enhancing a report
with graphics and OLE

How do I:

Find out what graphics are

Insert and move graphics

Size and scale graphics

Crop graphics

Create, move, and format graphic lines

Create, move, and format graphic boxes

Use graphic boxes to highlight data

Create tables

The status bar and graphic elements

Add OLE objects to my report


Topical Index to Private Tutor
 Topical Index to
Personal Trainer

 I want to see:

Topics on Building a Report

Topics on Graphics and OLE

Main Index to Personal Trainer


 Topics on
Building a Report

About sorting report data by group

About sorting report data by record

Aligning text with fields

Centering text, field values

Changing field and text fonts

Create a crosstab report

Creating group headers

Creating Margins

Crosstab Reports

Deleting Blank Lines

Export a report through electronic mail

Export a report to a disk file

Exporting Reports

Group data in crosstabs

Grouping Data

Grouping process

Hiding parts of the report

Highlighting Fields

How to sort groups

Inserting blank lines

Inserting Fields

Inserting page headers and footers

Inserting text

Invert a crosstab report

Nesting groups

Page Numbers and Other Special Fields

Page Orientation and Paper Size

Place fields in crosstabs

Return to Cross [image] Tab dialog box

Selecting Fields

Selecting records and groups

Selecting text

Sorting data

Spacing fields

Summarizing Grouped Data

To do simple grouping

To format page headers and footers

To generate your own selection formula

To group using nesting groups

To group and summarize data

To group and summarize using nesting groups

To insert page headers and footers

To sort report data by record

Use dates and Booleans in crosstabs


 Topics on
Graphics and OLE

Create a new OLE object from scratch

Create an OLE object from an existing file

Creating a line

Creating, moving, formatting boxes

Creating, moving, formatting lines

Creating tables

Cropping graphics

Cropping graphics concept

Cropping using the dialog box

Cropping using the mouse

Deleting a graphic

Edit an OLE object in your report

Formatting a box

Formatting a line

Graphic elements and the status bar

Including column headings in a table

Inserting and moving graphics

Moving a box

Moving a line

Moving graphics using the dialog box

Moving graphics using the mouse

Object Linking and Embedding

Positioning graphics with the status bar

Resizing a box

Resizing a line

Resizing using the Graphic Format dialog box

Resizing using the mouse

Sizing and scaling graphics

To create a box

To insert a graphic

To put a box around groups

To put a box around individual columns

To put a box around individual fields

To put a box around individual rows

To put a box around memo field values

To put a box around two or more rows

To put a box around two or more columns

Using boxes to highlight data

Using the Status bar with graphics


 Creating Margins

You set margins in Crystal Reports using the File|Page Margins command. 1. Select File|Page Margins, set your margins, and Click OK when finished.   Crystal Reports uses a dashed line to display your margins in the Report Designer and Label Designer.   The numeric margin settings appear in both the Mailing Labels dialog box and in the Printer Margins dialog box.   All margins are calculated from the paper edge. Thus, a left margin of .25 inches causes the printing to start exactly one quarter inch in from the edge of the paper.


 Inserting blank lines

To insert a blank line:

1.	Click the gray area to the left of the section in which you want to enter the blank line.

2.	Click the right mouse button.

3.	Select Add Line from the menu that appears.

4.	Repeat the process for each blank line you want to insert.

NOTE: There are other ways that you can add blank lines. See the Inserting Blank Lines topic in Crystal Reports Help.


 Deleting Blank Lines

By default the Report Designer allots three lines for the Page Header section and three lines for the Page Footer section of your report. The defaults may allot more lines than you need for those items on your report.

Additionally, you may expand a section on your report by a random number of lines prior to inserting text and data, just to make sure you have enough room for your entries. You may find that you have added more lines than necessary


Deleting Blank Lines 2
 Deleting Blank Lines

Printing the report without first deleting the unneeded blank lines can leave gaps in your report that make the report less attractive visually and more difficult to read.

To delete unneeded blank lines

If an entire section is blank (i.e., if you aren't putting anything into the Page Footer section of your report), you can eliminate the allotted blank lines by eliminating the entire report section via the Hide Section option of the Format Section command.


Deleting Blank Lines 3
 Deleting Blank Lines

If you have text and/or data in a section and just want to remove the extraneous blank lines, Click the I--beam cursor on the blank line you want to delete. This sets the insertion point. Once the insertion point is set. press the Backspace key (the key that deletes the previous character); Crystal Reports deletes the line on which the insertion point is set.


Deleting Blank Lines 4
 Deleting Blank Lines

Example

Assume that you have entered text in the first line of the Page Header section and that you have entered data fields in the details section. You want to delete the bottom blank line in the Page Header section. To do this:

1.	Position the I--beam cursor on the last (bottom) line of the Page Header section and Click the left mouse button to set the insertion point. The insertion point appears at the left edge of the Report Designer text box.


Deleting Blank Lines 5
 Deleting Blank Lines

2.	Press the Backspace key one time. The bottom blank line disappears.

To delete the remaining blank line

When you deleted the bottom blank line in the Page Header section, the insertion point moved up to the remaining blank line (what had been Line 2, the center line in the section). To delete this line, press the Backspace key once again. Now all that remains is the line of text you entered in the section.


 Inserting page
headers and footers

 I want to:

  Insert page headers and footers.

  Format page headers and footers.


 To insert page
headers and footers

Insert page headers and footers by placing the information in the appropriate section of the Report Designer.

header information goes in the Page header section

footer information goes in the Page footer section

Any information you place in these sections prints on each page of the report.

You can use text, fields, or formulas in these sections just as you can in the Details section.


 To format page
headers and footers

You can format each element in a header or footer in the same way as you would format that element if it appeared in the details section:

you can change the font for text, fields, or formulas,

you can center the values horizontally on the page, center them over your report data, or align them flush left, centered, or flush right within the space allotted for them,


To format page headers and footers 2
 To format page
headers and footers

you can change the way dates, numbers, and currency appear when they print, and

you can suppress any blank lines that occur in the section.

To format a header or footer element, select the element and then select the formatting option of interest.


 Page Numbers and
Other Special Fields

Crystal Reports gives you the ability to insert special fields in your reports (in addition to the data fields you draw from databases). These special fields allow you to insert dates, page numbers, and group and record numbers in your report. Choose the special field of interest from the list below:

  Date Field

  Page Number Field

  Record Number Field

  Group Number Field


Page Numbers and Other Special Fields 2
 Date Field

1.	Select Special Field|Date from the Insert menu.

2.	When the Date field box appears, place the field on your report where you want the print date to appear.


Page Numbers and Other Special Fields 3
 Page Number Field

1.	Select Special Field|Page Number from the Insert menu.

2.	When the Page Number field box appears, place the field on your report where you want the current page number to appear.


Page Numbers and Other Special Fields 4
 Record Number Field

1.	Select Special Field|Record Number from the Insert menu.

2.	When the Record Number field box appears, place the field in the Details section of your report at the point where you want the record number to appear.


Page Numbers and Other Special Fields 5
 Group Number Field

1.	Select Special Field|Group Number from the Insert menu.

2.	When the Group Number field box appears, place the field in the Group section at the point where you want the Group number to appear.

NOTE: If you have more than one group, place the field in the Group section for the group you want to number.


 Hiding parts of the report

Crystal Reports has four formatting commands that suppress (hide) various parts of a report. Select the commands that meet your needs from the dialog boxes indicated in parentheses. Suppress if Duplicated   Suppress if Duplicated (Format String, Number, etc. dialog box) prevents a field value from printing if it is identical to (a duplicate of)  the value that comes immediately before it. The value doesn't print but the space in which it would have printed remains.  Click on the report at right to see what happens when duplicate values are suppressed.


Hiding parts of the report 2
 Hiding parts of the report

Suppress if Zero  Suppress if Zero (Format Number dialog box) prevents a value from printing if it is a zero value. The value doesn't print but the space in which it would have printed remains.  Click on the report at right to see what happens when zero values are suppressed.


Hiding parts of the report 3
 Hiding parts of the report

Suppress Blank Lines  Suppress Blank Lines (Format Section dialog box) eliminates nonessential blank lines from your report.  Click on the report at right to see what happens when blank lines are suppressed.


Hiding parts of the report 4
 Hiding parts of the report

Hide when Printing  Hide when Printing (Format String, Number, etc. dialog box) prevents a field from printing. The field doesn't print but the space allotted for the field remains.  Click on the report at right to see what happens when the Cost column is hidden when the report is printed.


 Page Orientation
and Paper Size

You can use Crystal Reports with a variety of paper sizes. You select paper sizes via the printer configuration resources that are accessed through the File|Printer Setup command.

How to change the paper size, orientation, etc.

1.	Select File|Printer Setup.


Page Orientation and Paper Size 2
 Page Orientation
and Paper Size

2.	When the Print Setup dialog box appears, activate the printer you want to use if it is not already the active printer. Your paper size options are directly related to the printer you have selected. For example, the HP LaserJet driver (PCL) offers a choice of letter, legal, executive or A4 paper sizes whereas the PostScript printer driver lets you choose from letter, legal, note, A4, B5, letter small, and A4 small paper sizes.


Page Orientation and Paper Size 3
 Page Orientation
and Paper Size

3.	Select either Portrait or Landscape orientation by clicking on the appropriate radio button in the Orientation box.

4.	Select the paper size desired and its source from the scroll lists in the Paper box.

5.	Click OK when finished.


 Exporting Reports

How do I:

Learn more about exporting reports?

Export a report to a disk file?

Export a report and send it through electronic mail?


Exporting Reports concept
 Exporting Reports

The File|Print|File command enables you to print your report to an electronic file in a format that can be read by another software application. For example, you could export your report in Microsoft Excel format and then open it in Excel as a normal spreadsheet file.


Exporting Reports concept 2
 Exporting Reports

The exporting facility supports several popular word processing, database, and spreadsheet formats,and a number of standard data interchange formats as well. The list at right shows the many formats Crystal Reports can export to. If Crystal Reports does not export directly to your application's native format, it more than likely exports to a format your application can read nonetheless. For example, many applications can read data saved in an ASCII or text format. Even though your application isn't on the list of supported formats, you may be able to export to a text file and then have your application read in the data (import it) from that format. Check your application's documentation to see which formats it can import.	Report [image] specific formats Crystal Reports format Word processor [image] specific formats Word for Windows, Word for DOS Word Perfect Rich Text Format (RTF) Spreadsheet [image] specific formats Lotus 123 (WKS), (WK1), (WK3) Excel 2.1, 3.0, 4.0 (XLS) Database [image] specific formats Paradox Common data [image] interchange formats Comma separated values (CSV) Tab separated values Character separated values Text style Tab separated text style DIF (data interchange format) style Record style Extended record style


Exporting Reports concept 3
 Exporting Reports

Exporting to electronic mail Crystal Reports also allows you to attach an exported file to a message sent via an electronic mail system. The message displays an icon that indicates a report is attached. The person who receives the message Double Clicks the icon, and the report appears on screen.


 Exporting Reports
to a disk file

To export a report to a disk file:

1.	With the report active that you want to export, select the File|Print command and select File from the submenu. The Export dialog box appears.

2.	The dialog box is broken into two sections, a Format section and a Destination section.

3.	In the Format drop [image] down list box, select the format in which you would like to export the report. For example, if you would like to convert the report to Microsoft Excel 4.0's native format, choose Excel 4.0 (XLS) from the list.


Exporting Reports to a disk file 2
 Exporting Reports
to a disk file

4.	In the Destination drop [image] down list box select Disk file.

5.	Click OK. The Choose Export File dialog box opens.

6.	Use the Drives, Directories, and File List and File text boxes to select a path and filename for your file.

7.	Click OK. The program exports the report to a disk file in the format you've selected.


 Exporting Reports
to electronic mail

To export to E-mail:

Since the E [image] mail systems supported by the exporting facility each operate a little differently, the following instructions are generic in nature.

1.	With the report active that you want to export, select the File|Print command and select File from the submenu. The Export dialog box appears.

2.	The dialog box is broken into two sections, a Format section and a Destination section.


Exporting Reports to electronic mail 2
 Exporting Reports
to electronic mail

3.	In the Format drop [image] down list box, select the format in which you would like to export the report. For example, if you would like to convert the report to Microsoft Excel 4.0's native format, choose Excel 4.0 (XLS) from the list.

4.	In the Destination drop [image] down list box select the appropriate Mail application.

5.	Click OK.

6.	The program asks you to log onto your system. Log on in the normal way.


Exporting Reports to electronic mail 3
 Exporting Reports
to electronic mail

7.	Select the individual(s) to whom you are going to send the report.

8.	When the message screen appears, the system displays an icon indicating that a report is attached. The icon will vary, depending on the format you used to export the report.

9.	Type in any message that you want to include with the report.


Exporting Reports to electronic mail 4
 Exporting Reports
to electronic mail

10.Send the message. A Record Counter appears so you can monitor the progress of your export.

11.When the export is finished, the message you sent (and the attached report) will appear in the addressee's mailbox. The recipient can view the report by double [image] clicking the icon that appears if the report has been associated to an application by File Manager.


Exporting Reports to electronic mail 5
 Exporting Reports
to electronic mail

NOTE: If you have questions regarding the operation of your electronic mail system, please refer to the documentation that came with the system.


 Inserting text

Add text by typing it at the insertion point, or by using the Insert|Text Field command.

To insert text directly

1.	Move the I--beam cursor to the line on which you wish to enter text.

2.	Click the left mouse button to set the insertion point.

3.	Type in your text. This is a text string.

4.	Move the I--beam cursor in front of the text, Click to set the insertion point, and push the text into position using the Tab key.


Inserting text 2
 Inserting text

To insert text using a text field

1.	Select Insert|Text Field. The Edit Text Field dialog box appears.

2.	Enter your text in the Enter Text edit box, and Click Accept when finished. A field placement box appears.

3.	Position the field box where you want the text field to appear and click the left mouse button to place it.


 Selecting text

To do many things with text (change the font, delete it, etc.), you first have to select it. Select means to highlight the text by dragging the I--beam cursor over it while holding down the left mouse button. Your next action (changing the font, selecting Edit|Cut, etc.) acts upon the text selected.

NOTE:  When text is in a text field, you select it as you would select any field.


 Aligning text with fields

You may want to align text with column data (fields). To do this, place your fields, type your text, and move the text into position using the Tab key. Always use the Tab key and not the Space Bar.

Spaces on the screen take up a different amount of space than spaces on the printer. What looks like it is aligned on screen (using the Space Bar) may not be aligned when you print. However, if text and fields are aligned to a given tab stop on screen, the elements will also be aligned when you print.


Aligning text with fields 2
 Aligning text with fields

To align text with fields

To align text with fields, you move the text, the field, or both.

Move the text with the Tab key. Each time you press the Tab key the text moves six grid positions.

Move the fields with the Arrow keys. Each time you press one of the Arrow keys, the text moves one grid position.


Aligning text with fields 3
 Aligning text with fields

NOTE:  If you want to center the text over a field, or right or left align it, you can type the text into a text field and use the Format|Field alignment commands or the alignment buttons to set the alignment of the text within the text field (See Centering Text and Fields).


Aligning text with fields 4
 Aligning text with fields

NOTE:  Text can be moved right and left (with the Tab and Backspace keys) and so can fields (with the Right Arrow and Left Arrow keys). By moving text and fields in concert, you should easily be able to get good alignment.


Aligning text with fields 5
 Aligning text with fields

NOTE: To align field titles with fields it's best to work from left to right. Make certain the first title is aligned with its field, then align the second title with its field, etc. Aligning, in this case, consists of aligning the left edge of the title with the left edge of the field.

NOTE: For the best (and easiest) alignment of text and field data, enter your text elements as text fields using the Insert|Text Field command (instead of entering the text directly onto the report).


Changing field and text fonts
 Changing field fonts

You can change fonts for any field value in your report using the Font dialog box.

1.	Select the field(s) for which you want to change the font.

  To select a single field, Click the field.

  To select multiple fields, hold the Shift key down while you Click the fields or lasso the fields you want to select using the Edit|Select Fields command.

Handles appear on the selected field(s).


Changing field and text fonts 2
 Changing field fonts

2.	Select Format|Font or Click the right mouse button and select Change Font from the pop--up menu. The Font dialog box appears.

3.	Make the font, style, size, color, and/or effects changes you want and Click OK when finished.

NOTE: You can also change the font and the font size via the Format Bar.


Changing field and text fonts 3
 Changing text fonts

You can change fonts for any text string in your report using the Font dialog box.

To change fonts for a text string

1.	With the left mouse button depressed, drag the I--beam cursor over the text of interest to select it.


Changing field and text fonts 4
 Changing text fonts

2.	Select Format|Font or Click the right mouse button and select Change Font from the pop--up menu. The Font dialog box appears.

3.	Make the font, style, size, color, and/or effects changes you want and Click OK when finished.

NOTE: You can also change the font and the font size via the Format Bar.


Centering text, field values
 Centering text
field values

To center text and field values, you use the Crystal Reports' alignment command or center alignment button.

To center text

1.	Select Insert|Text Field and create a text field that contains the text you want.

2.	Place the text field in the approximate position you want it to appear on the report.

3.	Change the font, font size, and font style for the text field if you wish.


Centering text, field values 2
 Centering text
field values

4.	Resize the text field box so it matches the margins within which you wish to center the text. For example, if you want to center text beneath a report title, expand the field box so it's the same size as the report title (or report title field box). If you want to center a header entry over the body of the report, expand the header entry field box so it's the same width as the data in your report.


Centering text, field values 3
 Centering text
field values

5.	Select Format|Field, and then select centered from the Alignment drop down list in the Format dialog box when it appears.

6.	Select OK when finished; Crystal Reports centers your text within the expanded field box, and thus, to your specifications.

NOTE: As a shortcut, Click the Center Alignment button [image] instead of selecting Format|Field.


 Inserting Fields

Use Insert|Database Field to place data fields from an active database on your report.

To use Insert|Database Field

1.	Select Insert|Database Field. The Insert Database Field dialog box appears listing all of the fields in the active database(s).

NOTE: If you're working with Btrieve and using a .ddf file that contains more than four database files, Crystal Reports displays only the file names, not the field names. Search for Btrieve files in Crystal Reports Help for further information.


Inserting Fields 2
 Inserting Fields

NOTE: To speed the report building process, this dialog box is set to remain on screen until you Click the Done button. The dialog box can be moved anywhere on screen that is convenient.

2.	Select the field(s) you want to appear on your report.

  To select a single field, Click the field.


Inserting Fields 3
 Inserting Fields

  To select multiple fields:

  if you want to select two or more fields that are grouped together, press the Shift key and then, while keeping it depressed, Click the fields you want to select.

  if you want to select two or more fields that are separated by fields you don't want to select, press the Ctrl key and, while keeping it depressed, Click the fields you want to select.


Inserting Fields 4
 Inserting Fields

NOTE: To quickly select a range of fields you can ShiftClick the first and the last field in the range and the program will automatically select all intervening fields.


Inserting Fields 5
 Inserting Fields

3. With the field(s) selected you can place them on your report:

If you selected a single field, you can Click the insert button or DoubleClick the field to call up the placement cursor, or you can drag and drop the field directly onto your report.


Inserting Fields 6
 Inserting Fields

If you selected multiple fields, you can drag and drop them onto your report.

  To place a single field using the Insert button or DoubleClick techniques, position the placement cursor in the Report Designer where you want the field to appear and Click the left mouse button to place it.


Inserting Fields 7
 Inserting Fields

  To drag and drop a single field, Click the field of interest and then, while keeping the mouse key depressed, position the drag and drop cursor where you want your field to appear in the Report Designer. Release the mouse key to place the field.


Inserting Fields 8
 Inserting Fields

  To drag and drop multiple fields, Click on any of the selected fields in the group, and, with the mouse key depressed, position the drag and drop cursor where you want your fields to appear. Release the mouse key to place the fields. They will appear next to each other in the order they appeared on the field list.


Inserting Fields 9
 Inserting Fields

4.	Repeat Steps 2 and 3 until you have inserted all the fields you want to insert.

5.	Click Done when finished, and the dialog box disappears.


 Selecting Fields

To do many things with a field (change the font, move it, etc.), you first have to select it. Select means to point to the element with the mouse and then to Click the left mouse button to choose the element as the field you want to perform some action on. When you select a field, black handles appear on the field box. These handles indicate that the field is selected, and therefore active.  Click on the picture at right to see what happens when you select a field.


Selecting Fields 2
 Selecting Fields

Once a field is selected, you then tell Crystal Reports what you want to do with it. For example, to change font size, you first select the element for which you want to change the font size. Then you select the Font option from the Format menu (or Change Font from the right mouse button menu) to select the new font size. The new font size applies only to the field you selected.


 Selecting multiple fields at one time

Multiple fields can be selected in one of two ways: The Shift-Click combination or the Selection tool. To use the Shift-Click combination, press the Shift key and, while keeping it depressed, Click the various fields you want to select. Handles will appear on each field selected. You can then move or delete the fields as a group. You can also change the font or formatting or add borders for all selected fields.


Selecting multiple fields at one time 2
 Selecting multiple fields at one time

To use the Selection Tool, select the Edit|Select Fields command or Click the Selection lasso button on the Button Bar. The mouse cursor changes to crosshairs. Position the crosshairs above and to one side of the fields you wish to select, then hold the mouse button down and drag a selection rectangle toward the bottom and opposite side of the fields, surrounding them with the selection rectangle. Release the mouse button. The rectangle disappears, and handles appear on all of the selected fields.  Click on the picture at right to see how to select multiple fields with the Selection Tool. The Selection Tool:


 Spacing fields

You set spacing between data fields by placing the fields where you want them. If you're working in the Print Window, you can see the spacing using actual data.


Spacing fields 2
 Spacing fields

Spacing considerations

Here are some things that can affect column spacing:

Field size

The amount of space allotted for a field may be much greater than the size of the value that appears in the field.

  In a number or dollar amount field (which is right justified by default), this can create a large number of leading blank spaces which can impact field spacing.


Spacing fields 3
 Spacing fields

  In all other fields (which are left justified by default), it can create a large number of trailing blank spaces which can impact field spacing.

You can reduce the amount of space allotted for a field by selecting the field and then resizing it using the mouse or a Shift--Left Arrow or Shift--Right Arrow key combination.


Spacing fields 4
 Spacing fields

Mouse

To reduce the size of a field in the Report Designer using the mouse, select the field and then drag either of the handles to make the field box smaller.

Shift--Left Arrow key

To reduce the size of a field in the Report Designer using the Shift--Arrow key combination, select the field, press the Shift key, and, while keeping it depressed, press the Left Arrow key enough times to reduce the field to the desired size.


Spacing fields 5
 Spacing fields

Alignment

Number and dollar amount fields are right justified by default; all other data types are left justified. A right aligned field following a left aligned field may appear to be spaced properly in the Report Designer. You may need to fine tune the spacing, however, once you review the report in the Print Window.


 Highlighting Fields

Crystal Reports makes it easy for you to highlight your data with borders and drop shadows, and color.

To create borders, drop shadows, and add field color

1.	Select the field(s) you want to highlight.

  To select a single field, Click the field.

  To select multiple fields, hold the Shift key down while you Click the fields. Handles appear on the selected field(s) or use the selection lasso via the Edit|Select Fields command.


Highlighting Fields 2
 Highlighting Fields

2.	Select Format|Border and Colors or Click the right mouse button and select Change Border and Colors from the pop--up menu. The Format Border and Colors dialog box appears.

3.	Set up the text color, fill (field color), border, and drop shadow you want.

4.	Click OK when finished to return to the Report Designer. The selected fields will be highlighted to your specifications.


Highlighting Fields 3
 Highlighting Fields

NOTE:  If you selected multiple fields, the same highlights will be applied to all fields. If you want to highlight different fields differently, you must select and highlight each unique field individually.


 Grouping Data

 I want to:

  Learn about simple grouping

  Create simple groups

  Learn about nesting groups

  Create nested groups


 Grouping Data

Grouping data means breaking your data into meaningful groups before it appears on your report. Crystal Reports makes it easy: to group your data, and  to evaluate or perform calculations on the data in each group. Simple grouping Simple grouping means breaking the data into groups without performing any additional action (totaling, averaging, etc.) on the grouped data. On a customer list, you may want to group your data by state for use by your telemarketing personnel. Crystal Reports can quickly organize your data into state groups so that each group contains only customers from a single state.


Grouping Data 2
 Grouping Data

On a sales report you may want to group data by sales rep (each group containing only sales made by a single sales rep) or by customer (each group containing only sales made to a single customer). Crystal Reports gives you the flexibility to group data in a variety of ways.


Grouping Data 3
 Grouping Data

Whenever Crystal Reports groups data, it first sorts the data, and then it breaks the sorted data into groups. For example, if you want to group a customer list by state, Crystal Reports first sorts the data by state. Then it begins a new group whenever the state changes. The data at right shows that process If all you want to do is group your data, you can do this easily with Crystal Reports using the Insert|Group Section command.	Original Data CO WA AZ CA CA AZ WA CO	Sorted by State AZ AZ CA CA CO CO WA WA	Grouped by State AZ AZ CA CA CO CO WA WA


 To do simple grouping

1.	Select the field you want to group. For example:

  if you want to group a customer list by state, select the field that contains the company name, or

  if you want to group an orders report by customer, select the field that contains the order amount.

2.	Select Insert|Group Section. The Insert Group Section dialog box appears.


To do simple grouping 2
 To do simple grouping

3.	In the top scroll box, select the field that you want to trigger a grouping, whenever its value changes. For example:

  if you want to group a customer list by state, select the state field, or

  if you want to group an orders report by customer, select the field that contains the customer name or customer number.

4.	In the second scroll box, select the sort direction (in ascending order = A to Z, 0 to 9, in descending order = Z to A, 9 to 0).


To do simple grouping 3
 To do simple grouping

5.	If you selected a date or Boolean field in the top scroll box, a third scroll box appears near the bottom of the dialog box. In this scroll box, select the date or Boolean condition that finalizes your subtotal specification.

6.	Select OK when finished. Crystal Reports groups the data to your specifications.


 Nesting groups

You may want to nest groups of data: group data within a group. For example, on a customer list, you may want to group your data by state, and then, within each state group, break the data down further, by city.  Crystal Reports allows you to do this easily: you use the Insert|Group Section command two times, first to set up the state group and then to set up the city group. NOTE:  You can add additional nesting levels as needed; there is no practical limit to how many nesting levels you can set up.


 To group using
nesting groups

1.	Select the field you want to group. For example:

  if you want to group a customer list by state and then, within each state group, group the list by city, select the field that contains the company name, or

  if you want to group an orders report by customer and then, within each customer group, group the list by date, select the field that contains the order amount.


To group using nesting groups 2
 To group using
nesting groups

2.	Select Insert|Group Section. The Insert Group Section dialog box appears.

3.	In the top scroll box, select the field that you want to trigger a grouping, whenever its value changes. For example:

  if you want to group a customer list by state and then by city, select the state field, or

  if you want to group an orders report by customer and then by date, select the field that contains the customer name or customer number.


To group using nesting groups 3
 To group using
nesting groups

4.	In the second scroll box, select the sort direction (in ascending order = A to Z, 0 to 9, in descending order = Z to A, 9 to 0).

5.	If you selected a date or boolean field in the top scroll box, a third scroll box appears near the bottom of the dialog box. In this scroll box, select the date or boolean condition that finalizes your subtotal specification.

6.	Select OK when finished. Crystal Reports groups the data according to the first set of specifications.


To group using nesting groups 4
 To group using
nesting groups

7.	Select the same field you selected in Step 1.

8.	Select Insert|Group Section again. The Insert Group Section dialog box appears.

9.	This time select the field that, whenever its value changes, will trigger the second grouping . For example:

  if you want to group a customer list by state and then by city, select the city field, or

  if you want to group an orders report by customer and then by date, select the date field.


To group using nesting groups 5
 To group using
nesting groups

10.Select the sort direction (in ascending order = A to Z, 0 to 9, in descending order = Z to A, 9 to 0).

11.Select OK when finished. Crystal Reports groups the data, this time using both sets of specifications.

12.Repeat Steps 7 to 11 for each additional group you want to set up.


 Summarizing
Grouped Data

 I want to:

  Learn about summarizing grouped data

  Group and summarize data

  Group and summarize using nesting groups


Summarizing grouped data 2
 Summarizing grouped data

Sometimes you may want to go beyond mere grouping of data. You may want to first group the data and then evaluate or perform calculations on the data in each group. You may want to sum, average, or count the values, calculate the standard deviation of the values, or determine the highest (maximum) or lowest (minimum) value in each group. You can sum the data using the Insert|Summary Field|Subtotal or Insert|Summary Field|Summary commands.  NOTE: The Insert|Summary Field|Subtotal command is simply a shortcut for setting up a summary field that adds the values in each group.


Summarizing grouped data 3
 Summarizing grouped data

You can average, count, calculate the variance or standard deviation, or determine the maximum or minimum values using the Insert|Summary Field|Summary command. NOTE: Not all summary field options are available for every data type. For example, you can't sum or average string fields.


 To group and
summarize data

1.	Select the field you want to group. For example:

  if you want to group a customer list by state and then count the number of values in each group, select the field that contains the company name, or

  if you want to group an orders report by customer and then determine the average sized order for each customer, select the field that contains the order amount.


To group and summarize data 2
 To group and
summarize data

2.	Select Insert|Summary Field|Summary. The Insert Summary dialog box appears.

3.	In the top scroll box, select the action you want to take on the grouped data. For example:

  if you want to count the number of values in each group, select Count, or

  if you want to average the values in each group, select Average.


To group and summarize data 3
 To group and
summarize data

4.	In the next scroll box, select the field that you want to trigger a grouping, whenever its value changes. For example:

  if you want to group a customer list by state, select the state field, or

  if you want to group an orders report by customer, select the field that contains the customer name or customer number.


To group and summarize data 4
 To group and
summarize data

5.	In the next scroll box select the sort direction (in ascending order = A to Z, 0 to 9, or in descending order = Z to A, 9 to 0).

6.	If you selected a date or Boolean field in the top scroll box, a third scroll box appears. In this dialog box, select the date or Boolean condition that finalizes your subtotal specification.

7.	Select OK when finished. Crystal Reports sorts the data, and then groups and summarizes it.


 To group and summarize
using nesting groups

1.	Select the field you want to group. For example:

  if you want to group and count a customer list by state and then, within each state group, group and count the list by city, select the field that contains the company name, or

  if you want to group and sum an orders report by customer and then, within each customer group, group and sum the list by date, select the field that contains the order amount.


To group and summarize using nesting groups 2
 To group and summarize
using nesting groups

2.	Select Insert|Summary Field|Summary. The Insert Summary dialog box appears.

3.	In the top scroll box, select the action you want to take on the grouped data. For example:

  if you want to count the number of values in each group, select Count, or

  if you want to sum the values in each group, select Sum.


To group and summarize using nesting groups 3
 To group and summarize
using nesting groups

4.	In the next scroll box, select the field that you want to trigger a grouping, whenever its value changes. For example:

  if you want to group and count a customer list by state and then by city, select the state field, or

  if you want to group and sum an orders report by customer and then by date, select the field that contains the customer name or customer number.


To group and summarize using nesting groups 4
 To group and summarize
using nesting groups

5.	In the next scroll box, select the sort direction (in ascending order= A to Z, 0 to 9, or in descending order = Z to A, 9 to 0).

6.	If you selected a date or Boolean field in the top scroll box, a third scroll box appears near the bottom of the dialog box. In this scroll box, select the date or Boolean condition that finalizes your subtotal specification.


To group and summarize using nesting groups 5
 To group and summarize
using nesting groups

7.	Select OK when finished. Crystal Reports groups and summarizes the data to your specifications.

8.	Select the same field you selected in Step 1.

9.	Select Insert|Summary Field|Summary. The Insert Summary dialog box appears;

10.Select the action you want to take on the grouped data.


To group and summarize using nesting groups 6
 To group and summarize
using nesting groups

11.This time select the field you want to trigger the second group (the group within the group) whenever its value changes. For example:

  if you want to group and count a customer list by state and then by city, select the city field, or

  if you want to group and sum an orders report by customer and then by date, select the date field.


To group and summarize using nesting groups 7
 To group and summarize
using nesting groups

12.Select the sort direction (in ascending order = A to Z, 0 to 9, or in descending order = Z to A, 9 to 0).

13.Select OK when finished. Crystal Reports sorts, groups, and summarizes the data to your specifications.

14.Repeat Steps 8 to 13 for each additional group you want to set up.


 Creating group headers

Crystal Reports allows you to place incremental headers above each group in your report. This feature allows you to give your reports a polished, professional appearance.


Creating group headers 2
 Creating group headers

Whenever you insert a group, Crystal Reports creates two new sections on your report. One section, the Group Footer section (#1: CUSTNUM in the screen shot), appears below the Details section. This section holds the group value field itself. A matching section, the Group Header section (also #1: CUSTNUM in the screen shot), appears above the Details section. Anything you place in this section will appear as a header for your group.  NOTE: Both sections are given the same designation so you can tell that they are tied together. The two sections are also tied together visually.


Creating group headers 3
 Creating group headers

If you put text in the Group Header section, the same text will appear as a header for each group on the report.


Creating group headers 4
 Creating group headers

If you put the same field in this section that you used for the sort and group by field, Crystal Reports will create a "live" header for each group. For example, if you have a subtotal that sorts and groups your data by Customer, putting a duplicate copy of the Customer field in the Group Header section for that subtotal heads each group with the customer name. You can then format this header field to make it stand out if you wish, using a larger point size, bold face or italics, etc.


Creating group headers 5
 Multiple groups for the same field

When you set up a second group for the same field, Crystal Reports creates a second group section on your report beneath the first group section. Likewise, it creates a second Group Header section above the first Group Header section. For each new group field section on an existing field, Crystal Reports creates a pair of sections that effectively bracket the existing sections. Each section is clearly marked so you can easily tell which header section goes with each group section.


Creating group headers 6
 Multiple groups for the same field

If you place headers in each of the Group Header sections, you get a report that is extremely easy to read. For example, if you have grouped your data by State and then by City within each state, each new State section will be headed by a State header, and each City section within the State section will be headed by a City header.


 Sorting data

 I want to:

  Learn about sorting data by record.

  Sort data by record.

  Learn about sorting data by group.

  Sort data by group.


About sorting report data by record
 Sorting report data by record

There is a logic to the way values are arranged when they appear in a column on your report. Initially, they are arranged in the same order as the data appears in your database. But data can be sorted in a variety of ways: A mailing list, for example, could be sorted in ascending order on the ZIP code field; that is, the customers would be sorted so that those with the lowest ZIP codes would appear first and those with the highest ZIP codes would appear last.


About sorting report data by record 2
 Sorting report data by record

It could also be sorted in ascending alphabetical order, on the last name field; that is, customers with last names beginning with A would appear first, and those with last names beginning with Z would appear last.


About sorting report data by record 3
 Sorting report data by record

It could also be sorted by street address or customer first name if you had some practical reason for doing so. Crystal Reports gives you the opportunity to change the existing sort order using the Report|Record Sort Order command.


 To sort report
data by record

1.	Select Report|Record Sort Order. The Sort Order dialog box appears.

2.	In the Report Fields box, highlight the first field you want to use as a sort field and Click the Add button to enter it as a sort field.

3.	Repeat the process until you have selected all the sort fields you want.

4.	Select the Sort Direction you want and Click OK when finished. Crystal Reports sorts the records to your specifications.


To sort report data by record 2
 To sort report
data by record

NOTE: If you group your data using the Insert|Group Section, Insert|Summary Field|Subtotal, or Insert|Summary Field|Summary command, Crystal Reports sorts your data automatically, as part of the grouping process. For example, if you sort a customer list by state, Crystal Reports first sorts the list alphabetically by state, before breaking it into state groups. In such a case, you don't have to use this command to generate the sorting.


About sorting report data by group
 Sorting report data by group

A group is a set of records that are related to each other in some way. In a customer list, for example, a group could consist of all those customers living in the same ZIP code, or in the same state. In a sales report, a group could consist of all the orders placed by the same customer, or all of the orders generated by a specific sales rep. Grouping data is similar to grouping the fruit at right. A database file could contain a random collection of apples, grapes, and bananas. When the fruit is grouped, All of the apples are grouped together, all of the grapes are grouped together, and all of the bananas are grouped together.


About sorting report data by group 2
 Sorting report data by group

Once the information is printed, Crystal Reports groups the different types of fruit together in your report. Data can than be gathered on the groups such as total number of each, average amounts, costs, etc. The picture at right shows our apples, grapes, and bananas grouped together in a report.


 The grouping process

When you group data, Crystal Reports first sorts the data by record and then groups it according to your specifications. Here is some data typical of that found in the {file.STATE} field of a customer list: In order to group the data by state and sort the groups by record count, Crystal Reports: (1) sorts the original data alphabetically by state, on the first pass.


The grouping process 2
 The grouping process

(2) It breaks the data into groups (whenever the value in the state field changes) on the second pass. The resulting groups appear in ascending alphabetical order; the group containing all the customers from Arizona comes before the group containing all the customers from California.


The grouping process 3
 The grouping process

(3) Finally, using the Report|Group Sort Order command, the program sorts the groups so that the group containing the most records (the State with the most customers) appears first, then the State with the second highest number of records, then the third, etc.


 How to sort groups

1.	Select Report|Group Sort Order. The Sort Order dialog box appears, listing all the groups that you have set up in your report. In our example, since customer data is grouped by state and the number of records in each state group is counted, a group name similar to this will appear in the Summary Fields box:

Group #n:customer.STATE

Count of customer.CUSTNAME


How to sort groups 2
 How to sort groups

Translated, this means that the {customer.CUSTNAME} field (the field that contains the customer name), is grouped and counted every time the value in the {customer.STATE} field changes.

2.	Select this group, Click the Add button, and Crystal Reports places it in the Sort Fields box and activates the Sort Direction options.


How to sort groups 3
 How to sort groups

3.	Since you want the largest groups (by count) to appear first and the smallest last, select Descending.

4.	Click OK when finished. Crystal Reports sorts the groups to your specifications.

NOTE: When you sort by group, nothing happens to the sort order of the records within a group; only the relative positions of the groups themselves change.


 Selecting records
and groups

 I want to:

  Learn about record and group selection.

  Generate a selection formula.


Selecting records and groups 2
 Selecting records and groups

You can include all records in your report, or you can restrict your report to specific records or groups of records. For example, you can print a sales report showing year to date sales for all sales reps in the country, or you can print a report that presents nationwide sales but only for the last month, or even a report that shows year to date sales but only for those sales reps in Texas and California. Your reports can be as inclusive or exclusive as you wish.


Selecting records and groups 4
 Selecting records and groups

Crystal Reports includes two commands on the Report menu for selecting records and groups. Record Selection Formula Group Selection Formula (bmc bullet.bmp} Using these two commands, you create your own selection formula (query) using the Expression Builder.


Selecting records and groups 6
 Selecting records and groups

Creating a selection formula The Record Selection Formula and Group Selection Formula commands take you to the Expression Builder so you can create your own selection formula. If you are not familiar with the Expression Builder, refer to the main Help file for dBASE for Windows. Using the Expression Builder, you can build a formula that restricts your report to the records or groups you specify.


Selecting records and groups 9
 Selecting records and groups

You can make your selection formulas as simple or complex as you wish. You can use most of the functions and operators available for building any formula. Your only restrictions are: your record or group selection formula must be Boolean, that is, it must return a Yes (True) or No (False) value. If you build a selection formula that isn't Boolean, you get an Error. it can't use a Subtotal, Grand Total, or Summary.


To generate your own selection formula
 To create a
selection formula

1.	Select Report|Record Selection Formula or Report|Group Selection Formula. The Expression Builder appears.

2.	Create your selection formula. For information on building a formula in the Expression Builder, refer to the main dBASE for Windows Help file.

3.	Click OK when you are finished. Crystal Reports will limit your report to the records/groups specified.


 CrossTab Reports

How do I:

Learn about crosstab reports

Create a crosstab report

Place fields in crosstabs

Return to Cross [image] Tab dialog box

Invert a crosstab report

Group data in crosstabs

Use dates and Booleans in crosstabs


CrossTab Reports concept
 CrossTab Reports

CrossTab reports follow a row/column format similar to a spreadsheet. This format allows you to quickly spot trends and make comparisons in your data. A crosstab report includes: one or more column headings, one or more row headings, and the values from a single field distributed among appropriate row and column intersections, then summarized at the end of each row and at the bottom of each column. In the picture at right, the crosstab report compares the items purchased by each customer. The Qty field shows the quantity of each item purchased for each customer and it is summarized at the end of each row and column.


CrossTab Reports concept 2
 CrossTab Reports

To illustrate crosstab reports, consider the following data representing only a portion of a fairly cumbersome columnar report.

	CUSTOMER	ITEM	QUANTITY
	A	1001	14
	A	1002	43
	A	1003	14
	A	1101	13
	A	1102	15
	B	1001	48
	B	1002	11
	B	1003	20
	B	1101	14
	B	1102	13
	C	1001	23
	C	1002	4
	C	1003	17
	C	1101	1
	D	1001	5
	D	1002	8

The report shows the quantity of each item purchased by each customer. But its columnar format makes the report long and difficult to use when trying to compare customers' purchasing habits.


CrossTab Reports concept 3
 CrossTab Reports

Now consider the same data presented in a crosstab report:

		1001	1002	1003	1101	1102	Total
	A	14	43	14	13	15	99
	B	48	11	20	14	13	106
	C	23	4	17	1		45
	D	5	8	2	6	19	40
	E	39	25	8	4	7	83
	F	18	8	1	14	10	51
	G	18	12	8		3	41
	H	11	13	3	3	2	32
	I	4				4	8
	J	10	5		6	1	22
	K	19	6	4		11	40
	L	24	5		2	9	40
	Total	233	140	77	63	94	607
customers (A, B,...L) make up the row headings,

items (1001,1002..1102) make up the column headings,

the quantity purchased by each customer is the summarized field.

values at row/column intersections show the quantity of each item bought by each customer.

Customer purchasing habits are much easier to compare using this report.


 Creating Crosstab
reports

The following instructions assume that you are building a crosstab report using a database file as your data source.

1.	Select File|New|CrossTab. The Choose Database File dialog box.

2.	Select the database from which you want to create a crosstab report, and Click OK when finished. The Cross [image] Tab dialog box appears.


Creating Crosstab Reports 2
 Creating Crosstab
reports

3.	From the Fields box, select the field you want summarized and drag it into the Summarized Field box.

4.	Again from the Fields box, select whatever fields you want for row headings and drag them into the Row box.


Creating Crosstab Reports 3
 Creating Crosstab
reports

5.	Again from the Fields box, select whatever fields you want for Column headings and drag them into the Column box.

6.	Click OK to exit the Cross [image] Tab dialog box and move to the Cross [image] Tab Designer. Once in the Designer, you can format fields, group your data, etc. to get the report the way you want it.

7.	Print your report using one of the File|Print options.


Placing fields in crosstab reports
 Placing fields in
a crosstab report

There are two ways you can select and place a field in the Cross [image] Tab dialog box

Drag and Drop, and

using the Add/Set buttons:

Drag and Drop

To drag and drop a field:

1.	Highlight the field name in the list in the Fields box.

2.	With the cursor on the highlighted field name, depress the left mouse button and, while keeping it depressed, drag the field where you want it to go.


Placing fields in crosstab reports 2
 Placing fields in
a crosstab report

3.	Release the mouse key to drop the field when you get it into position.

When you drag and drop a field on top of another field, the new field will appear in the field list beneath the old one.


Placing fields in crosstab reports 3
 Placing fields in
a crosstab report

You can also drag and drop fields between the Row, Column, and Summarized Field boxes or within any of those boxes. For example, if you have two fields in the Row box and you want to reverse the order in which they appear, drag the top field onto the bottom field and the fields will reverse positions.

If you have a field in the Summarized Field box and you drag a new field into that box, the new field will replace the old field.


Placing fields in crosstab reports 4
 Placing fields in
a crosstab report

Add/Set buttons

These buttons send the selected field to the specified destination (Rows box, Columns box, etc.).

1.	Highlight the field name in the Fields box list.

2.	Click the appropriate button to send it to the destination you want. For example, to add a highlighted field to the Columns box, Click the Add Column to Crosstab button and the program will enter the highlighted field in the Columns box.


Return to CrossTab dialog box
 Returning to the
CrossTab dialog box

Returning to the Cross [image] Tab dialog box

If at any point during the design of your crosstab report you need to return to the Cross [image] Tab dialog box:

1.	Click the right mouse button while the mouse cursor is positioned in the gray area to the left of the CrossTab Designer.


Return to CrossTab dialog box 2
 Returning to the
CrossTab dialog box

2.	Select Cross [image] Tab Layout from the pop [image] up menu that appears.

NOTE: Alternately, you can select Format|Section, select Cross [image] Tab from the Format Section (Sections) dialog box when it appears, Click OK, and then Click the Cross [image] Tab Layout button from the Format Section (Formatting) dialog box when it appears.


Inverting crosstab reports
 Inverting a
crosstab report

Inverting a crosstab report means to exchange the headings on the horizontal and vertical axes of the report. What were column headings become row headings, and vice [image] versa. There are many reasons you might want to do this, but the most common reason is to get the report to fit better on a page.


Inverting crosstab reports 2
 Inverting a
crosstab report

1.	With your crosstab report set up, Click the right mouse button in the gray CrossTab area to the left of the Cross [image] Tab Designer edit box. A pop [image] up menu appears.

2.	Select Invert Cross [image] Tab and the program inverts the report for you.

3.	Repeat the process if you want to return the report to its original format.


 Grouping data in
crosstab reports

You can group data in your crosstab report just as you do in any other report. You select a row or a column heading as your sort and group by field and the program breaks the report into a series of mini crosstab reports, each one showing a single group.


Grouping data in crosstab reports 2
 Grouping data in
crosstab reports

1.	In the Cross [image] Tab Designer, select the row or column field you want to use as your sort and group by field

2.	Select Insert|Group Section. The Insert Group Section dialog box appears.

3.	Select the sort and group by field you want to use and the sort direction and Click OK when finished. The program groups your crosstab to your specifications.


 Date & Boolean fields
in crosstab reports

When you use date or Boolean fields as summarized fields, the program handles them differently than it does when you use them as row or column headings.

When used as row or column headings, the program prints the actual field values. (In a date field, it prints the first or last date in the period specified.)


Date & Boolean fields in crosstab reports 2
 Date & Boolean fields
in crosstab reports

When used as  summarized field, however, the program summarizes the values and prints a count of values (or, if you specify, some other summary), not the actual field value.


 What are graphics?

Crystal Reports has the ability to access bit--mapped graphics, such as those you see at right. Bit--mapped graphics are the kind of graphics (pictures, logos, etc.) that are generally produced by paint programs and scanners. Crystal Reports allows you to use bit--mapped graphics in your reports from a wide variety of sources: scanners, paint programs, video capture cards, screen capture programs, CompuServe, commercial graphics developers, and shareware and public domain graphics suppliers.


What are graphics? 2
 What are graphics?

As long as a graphic is stored in a graphics format that works with Crystal Reports, you can use it in your report.  --  Most paint, scanner, screen capture, and video capture programs can save graphics in a compatible file format (.bmp, .pcx, .gif, .tif, or .tga). --  Many graphics programs allow you to import a graphic in a different format and save it in a format that is compatible with Crystal Reports.  --  There are many low cost shareware programs or free public domain programs that allow you to easily convert a bit--mapped graphic stored in one format to another.  Crystal Reports was designed for maximum graphics compatibility.


 Inserting and
moving graphics

 I want to:

  Insert a graphic

  Move a graphic using the mouse

  Move a graphic using the dialog box

  Delete a graphic


 To insert a graphic

1.	Select Insert|Graphic. The Choose Graphic File dialog box appears.

2.	Select the graphic you want to enter in your report, and Click OK when finished. Crystal Reports returns you to the Report Designer, and an outline the size of the graphic appears as an aid in placement.

3.	Position the outline where you want the graphic to appear and Click the left mouse button to place it. Crystal Reports displays the graphic where you placed it.


 Moving graphics
using the mouse

Move a graphic with the mouse if you want to determine its final placement visually.

To move a graphic using the mouse, Click the graphic and, keeping the left mouse button depressed, drag the graphic to the place you want it.


Moving graphics using the mouse 2
 Moving graphics
using the mouse

NOTE:  You can move the graphic within its current section, or move it to a new section if you wish. The position of the upper left hand corner of the graphic (not the position of the arrow) determines the section in which the graphic will appear.

NOTE:  Make sure you don't Click the graphic on the handles. If you do, you will resize the graphic when you drag it.


 Moving graphics
using the dialog box

Move a graphic using the dialog box if you want the graphic to appear at an absolute position on your report.

1.	Select the graphic you want to move and select Format|Graphic to call up the Graphic Format dialog box. (Alternately you can Double Click the graphic to call up the dialog box or select the graphic and then select Change Format from the right mouse button menu.)


Moving graphics using the dialog box 2
 Moving graphics
using the dialog box

2.	Click the Position button and the Graphic Position dialog box appears. This dialog box indicates the position of the graphic relative to the top left corner of its section.

  To position the graphic even with the top left corner (the top flush against the top of the section, the left side flush against the left side of the section), enter the following settings: Left 0.00, Top 0.00.


Moving graphics using the dialog box 3
 Moving graphics
using the dialog box

  To move the graphic to the right, increase the Left setting. For example, to move the graphic in two inches from the left edge of the section, enter 2.00 for the Left setting (assuming you're working in inches).

  To move the graphic down in the section, increase the Top setting. For example, to move the graphic down two inches from the top of the section, enter 2.00 for the Top setting.


Moving graphics using the dialog box 4
 Moving graphics
using the dialog box

NOTE:  Crystal Reports automatically resizes the section to accommodate the new graphic location.

3.	Click OK when finished to return to the Graphic Format dialog box, and Click OK once there to return to the Report Designer. Your graphic will be positioned according to your specifications.


 Deleting a graphic

Crystal Reports makes it easy for you to delete a graphic from your report.

To delete a graphic:

1.	Select the graphic you want to delete.

2.	Press the Delete key, or select Delete Graphic from the right mouse button menu.


 Sizing and
scaling graphics

 I want to:

  Learn about sizing and scaling graphics

  Resize a graphic using the mouse

  Resize a graphic using the Graphic Format dialog box


Sizing and scaling graphics 2
 Sizing and scaling graphics

Size and Scaling are two interrelated options that appear in the Graphic Format dialog box. Size refers to the absolute length and width of a graphic. If the original graphic is one inch wide, it has an absolute width of one inch. If you double the width of the graphic it has an absolute width of two inches. Scaling refers to the length and width of a graphic as a percentage of the original length and width. If the original graphic is one inch wide, it has a width scaling value of 100%. If you double the width of the graphic, it has a width scaling value of 200%.


Sizing and scaling graphics 3
 Sizing and scaling graphics

When you first place a graphic, Crystal Reports presents it in its original size (the size in which it was saved). --  When you change the size values in the Graphic Format dialog box, Crystal Reports adapts the scaling values to the new height and/or width.  Click on the graphic to see what happens when the sizing values are changed.


Sizing and scaling graphics 4
 Sizing and scaling graphics

--  When you change the scaling values in that dialog box, the program adapts the size values to the new height and/or width.  Click on the graphic to see what happens when the scaling values are changed.


Sizing and scaling graphics 5
 Sizing and scaling graphics

--  When you resize the graphic using the mouse, the program adapts the size values and the scaling values in the dialog box to the new height and/or width.


Sizing and scaling graphics 6
 Sizing and scaling graphics

When you select a graphic for placement, Crystal Reports presents an outline that indicates the original size of the graphic (the size in which it was saved). When you place the outline, the graphic replaces the frame. You can then enlarge or reduce the size of the graphic to fit your needs.  Click on the picture at right to see what happens when you place a graphic.


 Resizing using
the mouse

You can change the size of a graphic using a mouse via the sizing handles that appear on the sides and corners of the graphic when you select it.


Resizing using the mouse 2
 Resizing using
the mouse

The sizing handles

The handles on the right and left sides expand or reduce the width of the graphic without affecting the height. For example, if your graphic was a square initially, it becomes a rectangle with the top and bottom becoming longer than the sides (if expanded) or shorter than the sides (if reduced). This kind of sizing results in a graphic that has different proportions than the original.


Resizing using the mouse 3
 Resizing using
the mouse

The handles on the top and bottom of the graphic expand or reduce the height of the graphic without affecting the width. For example, if your graphic was a square initially, it becomes a rectangle with the sides becoming longer than the top and bottom (if expanded) or shorter than the top and bottom (if reduced). This kind of sizing also results in a graphic that has different proportions than the original.


Resizing using the mouse 4
 Resizing using
the mouse

The handles on the corners of the graphic expand or reduce the height and width of the graphic equally. If your graphic was originally a square, it remains a square even though it has been resized. This kind of sizing results in a graphic that retains the same proportions as the original.


Resizing using the mouse 5
 Resizing using
the mouse

NOTE:  Any time you resize a bit--mapped graphic, there may be some deterioration in quality, particularly in text and in diagonal and curved parts of the graphic. This has nothing to do with Crystal Reports; it is simply in the nature of a bit--mapped graphic. For best results, use the graphic in its original size. If you must resize, try to resize in 100% increments of the original (200%, 300%, etc.).


Resizing using the mouse 6
 Resizing using
the mouse

To resize using a mouse

1.	Click the graphic to select it. Handles appear on the sides and the corners.

2.	Resize the graphic by dragging on the appropriate handle.


 Resizing using the
Graphic Format dialog box

You can resize your graphic in two different ways using the Graphic Format dialog box:

resize a graphic to an absolute size, and

scale a graphic to a percentage of its original size.


Resizing using the Graphic Format dialog box 2
 Resizing using the
Graphic Format dialog box

Resizing to absolute size

To resize a graphic to an absolute size:

1.	Click the graphic to select it, then select Format|Graphic to call up the Graphic Format dialog box.

2.	Enter the new height and/or width in the Size box.

3.	Click OK when finished. Crystal Reports resizes your graphic to your new specifications.


Resizing using the Graphic Format dialog box 3
 Resizing using the
Graphic Format dialog box

To resize a graphic as a percentage of its original size

1.	Click the graphic to select it and then select Format|Graphic to call up the Graphic Format dialog box.

2.	Enter the new scale value for the height and/or width in the Scaling box.

3.	Click OK when finished. Crystal Reports resizes your graphic to your new specifications.


Resizing using the Graphic Format dialog box 4
 Resizing using the
Graphic Format dialog box

NOTE:  When you change the Size values, the Scaling values won't change while the dialog box is open. Also, when you change the Scaling values, the Size values won't change while the dialog box is open. The changes will appear the next time you open the dialog box.

NOTE:  Crystal Reports automatically resizes the appropriate report section to accommodate the resized graphic.


 Cropping graphics

 Where do you want to start?

  What does cropping graphics mean?

  How do I crop using the mouse?

  How do I crop using the dialog box?


Cropping graphics concept
 Cropping graphics

Cropping refers to cutting away those portions of your graphic that you don't want to print. If, for example, when you scanned your company logo from a letterhead you also scanned in some extraneous material (company address, corporate officers, etc.), you will probably want to sanitize the logo before you use it. Using Crystal Reports' cropping capability, you can easily cut away the extraneous material leaving only the logo to print.  Click on the graphic at right to see what happens when the extraneous text is cropped.


Cropping graphics concept 2
 Cropping graphics

Beginning with this as an original uncropped graphic: cropping will have the following effects:	Cropping bottom Cropping top


Cropping graphics concept 3
 Cropping graphics

Cropping right	Cropping left


Cropping graphics concept 4
 Cropping graphics

Cropping all four sides	Reverse (negative) cropping to add white space inside a border


 Cropping using
the mouse

Using the mouse is the easiest way to crop a graphic. There is no guesswork, and you see your results immediately on screen.

You crop by dragging the resizing handles while depressing the Shift key.

When you drag the top handle down, you cut the top part of the graphic off.

When you drag the bottom handle up, you cut the bottom part of the graphic off.

When you drag the right side handle to the left, you cut the right side of the graphic off.


Cropping using the mouse 2
 Cropping using
the mouse

When you drag the left side handle to the right, you cut the left side of the graphic off.

When you drag one of the corner handles into the graphic, you cut off part of two sides of the graphic at once (the top and a side, or the bottom and a side).

When you drag any of the handles away from the graphic (dragging the top handle up, the left handle to the left, etc.) you expand the frame and put white space between the graphic and the frame.


Cropping using the mouse 3
 Cropping using
the mouse

To crop a graphic using the mouse

1.	Select the graphic you want to crop. Sizing handles appear on the graphic.

2.	With the Shift key depressed, crop your graphic by dragging the appropriate sizing handle(s).

3.	When finished, release the Shift key, resize the graphic if needed, and move it into place.


 Cropping using
the dialog box

When you crop a graphic using the dialog box, you specify (in inches or centimeters) the piece of the graphic that Crystal Reports is to cut from the top, bottom, right, and/or left side.

NOTE:  This method of cropping can be particularly useful if you want to take a specific sized piece off each side of your graphic. For example, if you want to cut exactly one inch off all four sides of your graphic, you can do it more quickly and accurately with the dialog box than with the mouse.


Cropping using the dialog box 2
 Cropping using
the dialog box

To crop a graphic using the dialog box:

1.	Select the graphic you want to crop and select Format|Graphic to call up the Graphic Format dialog box. (Alternately you can Double Click the graphic to call up the dialog box or select the graphic and then select Change Format from the right mouse button menu.)


Cropping using the dialog box 3
 Cropping using
the dialog box

2.	In the Cropping box, enter the amount you want to crop from the Top, Left, Bottom, and/or right sides of your graphic.

Enter positive numbers to cut parts off your graphic.

Enter negative numbers to expand the frame, leaving white space between the frame and the graphic.


Cropping using the dialog box 4
 Cropping using
the dialog box

NOTE:  All cropping settings apply to the size of the original graphic. If the graphic has been resized before cropping, make certain you use the Original Size settings as guidelines when entering your new cropping instructions. As a general rule, when you are going to crop and resize a graphic, crop the graphic first, and then resize it.

3.	Click OK when finished. Crystal Reports returns you to the Report Designer with the Graphic cropped to your specifications.


Cropping using the dialog box 5
 Cropping using
the dialog box

NOTE:  While there are many options in the Graphic Format dialog box, to crop a graphic you only need to concern yourself with the cropping instructions. Crystal Reports automatically maintains the scale and adjusts the absolute size of the graphic so it will display and print to your specifications.


Cropping using the dialog box 6
 Cropping using
the dialog box

 To restore a cropped graphic to its original size and shape, change all of the Cropping of original settings to 0.00.

 To restore a resized graphic to its original size and shape, change both Scaling settings to 100%.

 To restore a cropped and resized graphic to its original size and shape, change both the cropping and the scaling settings as described above.


 Creating, moving,
formatting lines

 I want to:

  Create a line

  Move a line

  Format a line

  Resize a line


 Creating a line

To create a line

1.	Click Insert|Line. A pencil cursor appears.

2.	Set the tip of the cursor (the pointed end) where you want the line to begin and drag the cursor horizontally or vertically with the left mouse button depressed. The line appears as you drag the cursor.

3.	Release the mouse button when the line is the length you want it.


 Moving a line

You can move a graphic line using the mouse, or with the keyboard using the arrow keys.

To move a line using the mouse:

1.	Click the line to select it.

NOTE:  When selecting a line or other graphic, the mouse cursor must be an Arrow. Make sure the cursor changes to an arrow before you attempt to select a line.

2.	Keeping the left mouse button depressed, drag the line where you want it.

3.	Release the mouse button once your line is in position.


Moving a line 2
 Moving a line

To move a line with the arrow keys

1.	Click the line to select it.

2.	Use the arrow keys to move the line up, down, right, or left and position it where you want it.

NOTE:  Crystal Reports displays line coordinates in the Status Bar to help you adjust the size and position of a line. Use the status bar to place a line at a specific location on your report, or align two or more graphic elements with each other.


 Formatting a line

To format a graphic line.

1.	Select the line of interest and then select Format|Line. The Line Format dialog box appears.

2.	Enter your formatting instructions for the style, width, and color of the line.

3.	Click OK when finished. Crystal Reports returns you to the Report designer with the line formatted to your specifications.


 Resizing a line

To resize a line using the mouse

1.	Select the line you wish to resize.

2.	Move the mouse so that the cursor is over one of the square sizing handles at the endpoints of the line.

NOTE:  When the mouse cursor is over one of the sizing handles, it changes to a double headed arrow (the Resizing cursor).


Resizing a line 2
 Resizing a line

3.	Click the left mouse button and, keeping the button depressed, drag the handle until the line is the length you want.

4.	Release the mouse button when finished.


Resizing a line 3
 Resizing a line

To resize a line using the arrow keys:

1.	Using the mouse, select the line you want to resize.

2.	While holding down the Shift key, press:

the Right Arrow key to lengthen a horizontal line,

the Left Arrow key to shorten a horizontal line,

the Down arrow key to lengthen a vertical line, or

the Up arrow key to shorten a vertical line.


 Creating, moving,
formatting boxes

 I want to:

  Create a box

  Move a box

  Format a box

  Resize a box


 To create a box

1.	Click Insert|Box. A pencil cursor appears.

2.	Set the tip of the cursor where you want to anchor one corner of the box and, with the left mouse button depressed, drag the cursor towards the opposite corner. The box appears as you drag the cursor.

3.	Release the mouse button when the box is the size you want it.


 Moving a box

You can move a graphic box using the mouse, or with the keyboard arrow keys.

To move a box using the mouse

1.	Click the box to select it.

NOTE:  You can select a box only with an arrow cursor. Position the I--beam near the box edge until it changes to an arrow and then Click the edge of the box (not the center) to select it.


Moving a box 2
 Moving a box

2.	With the left mouse button depressed, drag the box where you want it.

3.	Release the mouse button once your box is in position.

To move a box with the arrow keys

1.	Click the box to select it.

2.	Use the arrow keys on the keyboard to move the box up, down, right, or left until it is in the position that you want.


Moving a box 3
 Moving a box

NOTE:  Crystal Reports displays box coordinates in the Status Bar to help you adjust the size and position of a graphic box. Using the status bar readings, you can easily place a box at a specific location on your report, or align two or more boxes with each other.


 Formatting a box

Crystal Reports allows you to change:

the box style (the kind of line that outlines the box: single solid line, single dashed line, etc.),

the width (thickness) of the line that outlines the box,

the color of the line that outlines the box, and

the fill for the box (whether the box is filled with a color or empty).

You enter box formatting specifications in the Box Format dialog box.


Formatting a box 2
 Formatting a box

To format a box.

1.	Select the box of interest and then select Format|Box. (Alternately, you can Double Click the box or select Change Format from the right mouse button menu.) The Box Format dialog box appears.

2.	Enter your formatting instructions for the box.

3.	Click OK when finished. Crystal Reports returns you to the Report Designer with the box formatted to your specifications.


 Resizing a box

Once you have created a box, you can adjust its size using either the mouse or the keyboard arrow keys.

To resize a box using the mouse

1.	Select the box you wish to resize.

2.	Move the cursor over one of the square sizing handles.

NOTE:  When the cursor is over one of the sizing handles, it changes to a double headed arrow (the resizing cursor).


Resizing a box 2
 Resizing a box

3.	With the left mouse button depressed, drag the handle until the box is the size you want:

If you want to change the height of the box, drag the handle at the top or the bottom.

If you want to change the width of the box, drag the handle at the right or the left side.

If you want to change both the height and the width at the same time, drag one of the handles at the corners of the box.


Resizing a box 3
 Resizing a box

To resize a box using the arrow keys:

1.	Using the mouse, select the box you want to resize.

2.	While holding down the Shift key, press:

the Right Arrow key to make the box wider,

the Left Arrow key to make the box narrower,

the Down arrow key to make the box taller, or

the Up arrow key to make the box shorter.


 Using boxes to
highlight data

 I want to:

  Learn how boxes can highlight my data

  Put a box around fields

  Put a box around rows

  Put a box around two or more rows

  Put a box around columns

  Put a box around two or more columns

  Put a box around groups

  Put a box around memo fields


Using boxes to highlight data 2
 Using boxes to highlight data

Boxes can be used to highlight data in a variety of ways. For example, they can be used to highlight:  fields,	rows,  columns,


Using boxes to highlight data 3
 Using boxes to highlight data

groups of data, and   memo fields.	Each of these highlighting assignments requires a slightly different technique, but all can be accomplished easily with Crystal Reports. While you can use borders to create certain kinds of boxes, there are many times when using a graphic box is more appropriate.


 To put a box around
individual fields

1.	Select Insert|Box. The Pencil Cursor appears.

2.	Draw a box around the field of interest. Keep the entire box in the section in which the field resides. For example, to draw a box around a field in the Details section, keep the entire box in the Details section. The box can exactly match the field box outline or it can be bigger or smaller (as long as it doesn't overlap other fields), but it must remain within the same section as the field you're highlighting.


 To put a box around
individual rows

1.	Select Insert|Box. The Pencil Cursor appears.

2.	Draw a box around the row of interest, being careful to keep the entire box in the section in which the row resides. For example, to draw a box around a row in the Details section, keep the entire box in the Details section. The box can exactly enclose the row or it can be bigger or smaller, but it must remain within the same section as the row you're highlighting.


 To put a box around
two or more rows

1.	Select Insert|Box. The Pencil Cursor appears.

2.	Draw a box around the rows of interest.

  Be careful to keep the entire box in the section in which the rows reside.

  Be careful not to overlap any rows you don't want to be included in the box.


To put a box around two or more rows 2
 To put a box around
two or more rows

For example, to draw a box around two rows in the Details section, keep the entire box in the Details section. The box can exactly enclose the rows or it can be bigger or smaller (as long as it doesn't overlap other rows), but it must remain within the same section as the rows you're highlighting.


 To put a box around
individual columns

This section assumes that the column of data you want to enclose is in the Details section since any fields you put in the Page Header or Page Footer section print only one value per page.

To put a box around individual columns:

1.	Select Insert|Box. The Pencil Cursor appears.


To put a box around individual columns 2
 To put a box around
individual columns

2.	Draw a box around the field of interest. Begin the box in the Page Header section and end the box in the Page Footer section. The box must span all three report sections to get the desired effect. When you print, Crystal Reports prints a box around the column selected.

NOTE:  If you hide either the Page Header section or the Page Footer section, you will get an incomplete box.


 To put a box around
two or more columns

This section assumes that the columns of data you want to enclose are in the Details section since any fields you put in the Page Header or Page Footer section print only one value per page.

To put a box around two or more columns:

1.	Select Insert|Box (or Click the Insert Box button on the button bar). The Pencil cursor appears.


To put a box around two or more columns 2
 To put a box around
two or more columns

2.	Draw a box around the fields of interest. Begin the box in the Page Header section and end the box in the Page Footer section. The box must span all three report sections.

When you print, Crystal Reports prints a box around the columns selected.

NOTE:  If you hide either the Page Header section or the Page Footer section, you will get an incomplete box.


 To put a box
around groups

This section assumes that you have already grouped your data.

To put a box around groups of data:

1.	Select Insert|Box (or Click the Insert Box button on the button bar). The Pencil cursor appears.

2.	Draw a box around the data of interest:

The box should begin in the Group Header section, enclose the field(s) of interest, and end in the Group Footer section. The box must span all three sections.


To put a box around groups 2
 To put a box
around groups

NOTE:  To include the group value in the box (the subtotal, count, etc. for the group), make sure you enclose that value in the box when you draw it. If you don't want to include the group value in the box, don't enclose it in the box. You must still draw the box so it ends up in the group footer section nonetheless.


 To put a box around
memo field values

1.	Select Insert|Box. The Pencil Cursor appears.

2.	Draw a box around the memo field of interest, making certain that:

  the entire box is in the section in which the field resides,

  the top of the box is vertically above the top of the field, and

  the bottom of the box is vertically below the bottom of the field.


To put a box around memo field values 2
 To put a box around
memo field values

3.	When you print, the program draws the box around the selected memo field.

NOTE:  You may have to expand the Details section in order to draw the box without having the box extend into another report section.


 Creating tables

 I want to:

  Create a table

  Include column headings in my table


Creating tables 2
 Creating tables

You can create attractive tables for your report quickly and easily using Crystal Reports' box and line drawing functions. A short example will demonstrate the basic principles involved.

NOTE:  If you want to reproduce this example yourself using Crystal Reports, you will find the database from which the data is drawn (detail.dbf) located in the CRW directory (or the directory where you installed Crystal Reports sample data).


Creating tables 3
 Creating tables

To create the example table

1.	Using detail.dbf, place the following fields side by side in the Details section and resize the fields to get the look you want:

detail.ORDERNUM

detail.QTY

detail.ITEMNUM

detail.PRICE

Leave a little room between the fields so you can enter table lines.


Creating tables 4
 Creating tables

2.	Create the following formula and name it EXTEND:

{detail.QTY}*{detail.PRICE}

3.	Place the formula in the Details section to the right of the detail.PRICE field.

4.	Subtotal the formula EXTEND so it prints a subtotal whenever the value in detail.ORDERNUM changes.

  Click here to see how the Report Editor should look.

  Click here to see how the printed data should look.


EXTEND formula subtotalled


EXTEND formula subtotalled


Creating tables 5
 Creating tables

5.	Draw a single box around all the data in the Details section. This will place a box around each row of data that appears in the Details section of your report.

  Click here to see how the Report Editor should look.

  Click here to see how the printed data should look.


Box around Details section


Box around Details section


Creating tables 6
 Creating tables

6.	Draw vertical lines between each of the fields in the Details section. Each line should extend exactly from the top to the bottom of the graphic box you drew in Step 2.

  Click here to see how the Report Editor should look.

  Click here to see how the printed data should look.


Vertical lines between fields


Vertical lines between fields


Creating tables 7
 Creating tables

7.	Draw a single graphic box around the subtotal data.

NOTE: Make certain the right edge of the box aligns with the right edge of the box you drew in Step 5, and make certain the left edge of the box aligns with the vertical line you drew between the last (rightmost) two fields (Step 6).

  Click here to see how the Report Editor should look.

  Click here to see how the printed data should look.


Table complete


Table complete


 Including column
headings in a table

1.	Use the column headings that the program generated automatically or enter new headings in the Page Header section using the Insert|Text Field command.

2.	Position and size the headings to get the look you want..

3.	If you are using the program--generated headings, select all of the headings by Clicking them one at a time while holding down the Shift key.


Including column headings in a table 2
 Including column
headings in a table

4.	Select Format|Font, and then Click the Underline checkbox in the Effects section of the Font dialog box to turn the underlining off.

5.	Draw a single graphic box around all of the headings.


Including column headings in a table 3
 Including column
headings in a table

Make certain that:

  the right edge of the box aligns with the right edge of the graphic box around the fields in your report, and

  the left edge of the box aligns with the left edge of the graphic box around the fields in your report.

  Click here to see how the Report Editor should look.

  Click here to see how the printed data should look.


Box around headings


Box around headings


Including column headings in a table 4
 Including column
headings in a table

6.	Draw vertical lines between each of the fields. Each line should extend from the top to the bottom of the graphic box you drew in Step 5. Each line should be directly above the corresponding line you drew between the fields of your report. The Status Bar coordinates can help you do this.

  Click here to see how the Report Editor should look.

  Click here to see how the printed data should look.


Vertical lines between headings


Vertical lines between headings


Including column headings in a table 5
 Including column
headings in a table

7.	All that remains is getting rid of the big gap between the headings and the rest of the table. We get rid of this gap by hiding the group header section for the subtotal group. In the gray area at the left of the Report Designer, Click the #1: ORDERNUM -- A section, Click the right mouse button, and select Hide from the pop--up menu that appears. Crystal Reports removes the section from the Report Designer.


Including column headings in a table 6
 Including column
headings in a table

NOTE:  The methods described in this tutorial are not the only methods you can use for creating tables. They were presented in order to familiarize you with some basic techniques. You may find that you can build tables with fewer boxes and lines by experimenting with techniques outlined in Using graphic boxes to highlight data.


Including column headings in a table 7
 Including column
headings in a table

NOTE:  Your report prints as one table. To break it into individual tables for each order number, Click the Group Footer section and press Enter one time. This puts a space after each subtotal and breaks the table apart at the same time.

If you break the table up this way and want to have column headings with each table, create the headings using text fields, unhide the group header section and place the text fields in that section.


Including column headings in a table 8
 Including column
headings in a table

NOTE:  If you plan to make font formatting changes , try to make those changes before you create the table. If you change font size or make other changes once you have the table in place, you may have to replace and resize lines and resize boxes to accommodate your changes.


 Using the Status
bar with graphics

 What do you want to learn about:

  Graphic elements and the status bar

  Positioning a graphic with the status bar


 Graphic elements and the status bar

Crystal Reports displays coordinates in the Status Bar whenever you are working with lines, boxes, or other graphics. These coordinates can help you adjust graphic position and size, and align one graphic figure with another. Reading the Status Bar coordinates Crystal Reports displays four coordinate values for the selected graphic element: L(eft): The position of the left side of the graphic element relative to the left margin of the report. R(ight): The position of the right side of the graphic element relative to the left margin of the report,


Graphic elements and the status bar 2
 Graphic elements and the status bar

T(op): The position of the top of the graphic element relative to the top margin of the report, or relative to the top of the section in which the top of the element appears. B(ottom): The position of the bottom of the graphic element relative to the top margin of the report, or relative to the top of the section in which the bottom of the element appears. Coordinates are expressed in either inches or centimeters, depending on your Measurement settings in the International section of the Windows Control Panel.


 Positioning graphics
with the status bar

You can position an element by the numbers by monitoring the status bar coordinates while you move the graphic into position.

To position a graphic element by the numbers

1.	Select the graphic element you want to position. The coordinates for the graphic appear on the Status Bar.

2.	With the left mouse button depressed, drag the graphic to the approximate place you want it to appear.

3.	Let up on the mouse button and read the coordinates.


Positioning graphics with the status bar 2
 Positioning graphics
with the status bar

4.	Select the graphic again and move it as needed.

5.	Let up on the mouse button again and read the coordinates.

6.	Repeat Steps 4 and 5 until you have the graphic exactly where you want it.


Positioning graphics with the status bar 3
 Positioning graphics
with the status bar

NOTE:  To make fine adjustments while using the coordinates on the Status Bar, you may find it easier moving your graphic element with the arrow keys instead of the mouse.

NOTE:  Status Bar coordinates can also help you resize, reproduce, and align graphic elements easily.


Object Linking and Embedding
 Object Linking and
Embedding (OLE)

How do I:

Learn more about OLE?

Create a new OLE object from scratch?

Create an OLE object from an existing file?

Edit an OLE object in my report?


Object Linking and Embedding 2
 Object Linking and Embedding (OLE)

In Windows, Object Linking and Embedding (OLE) allows you to use and edit information and files created in one application from within a another application. For example, you can add a spreadsheet chart to a report you create in Crystal Reports, then open the spreadsheet from within your report and make changes to the data. The updated spreadsheet appears in your report as well. In this case, the spreadsheet file is called an object, and Crystal Reports acts as a Container application. With Crystal Reports you can embed an object in your report, or link an object file to the report. Many software applications support OLE. Check with the documentation for your application to see if it is capable of creating OLE objects.


Object Linking and Embedding 3
 Object Linking and Embedding (OLE)

Linked Objects To link an object to your report, Windows copies an image from a file that already exists. Only the image of the object is added to your report. The actual data remains with the original file. When you open the object from within your report, the original file is opened inside the application that was used to create it. Any changes you make directly change the original file. If you want the data in your object to remain available to other applications, and to always reflect the most current changes to the data, link the object to your report.


Object Linking and Embedding 4
 Object Linking and Embedding (OLE)

Embedded Objects An embedded object can be created from within Crystal Reports, or can be created by copying information from a file that already exists. The data, as well as the image of the object, is saved with your report. The object can not be accessed outside of your report. If you want to create a new object for your report from scratch, or if you want to copy the information from an existing file and edit the data without ever affecting the original file, embed the object in your report.


Creating a new OLE object
 Create a new OLE
object from scratch

1.	Open your report in Crystal Reports.

2.	Select Insert|Object. The Insert Object dialog box appears.

3.	To create a new OLE object from scratch, Click the Create New option button. The new object will be embedded in your report.

4.	Select the type of object you would like to create from the Object Type list box. For example, to create a Paintbrush Picture object, select Paintbrush Picture.


Creating a new OLE object 2
 Create a new OLE
object from scratch

5.	Click OK when you're finished making selections and the program returns you to the Report Designer. A rectangle representing the object appears beneath the mouse cursor.

6.	Position the rectangle where you want the object to appear in your report and Click the left mouse button to place it. A gray box appears in your report representing the new (empty) OLE object, and an icon for the object application appears on your screen.


Creating a new OLE object 3
 Create a new OLE
object from scratch

7.	Double [image] Click on the gray object box. The object application will open. For example, if you are creating a Paintbrush Picture object, Microsoft Paintbrush will open.

8.	Create your new object using the tools and commands available in the object application.


Creating a new OLE object 4
 Create a new OLE
object from scratch

9.	Select File|Update. The new object is embedded in your report.

10.Select File|Exit & Return to Report. The object application closes, and you return to the Report Designer with the new object embedded in your report.


Creating an OLE object from a file
 Create an OLE object
from an existing file

1.	Open your report in Crystal Reports.

2.	Select Insert|Object. The Insert Object dialog box appears.

3.	To create an OLE object from the data in a file that already exists, saved on disk, select the Create from File option button in the Insert Object dialog box. The File text box appears.

4.	Type in the path and name of the file you want to use to create an OLE object.


Creating an OLE object from a file 2
 Create an OLE object
from an existing file

5.	Click the Link checkbox on if you want your object to be linked to the original file. leave it unchecked if you want the object to be embedded in your report.

6.	If you want the object to be displayed in your report as an icon rather than as an image of the actual data, Click the Display As Icon checkbox on, and choose an icon to appear in your report.


Creating an OLE object from a file 3
 Create an OLE object
from an existing file

NOTE: Some object applications will only display objects as icons. Microsoft Word for Windows and Sound Recorder are examples of this kind of application.


Creating an OLE object from a file 4
 Create an OLE object
from an existing file

7.	Click OK when you're finished making selections and the program returns you to the Report Designer. A rectangle approximating the size of the object or icon appears beneath the mouse cursor.

8.	Position the rectangle where you want the object to appear in your report and Click the left mouse button to place it. The object or an icon representing the object will appear in your report.


 Editing an OLE object
in your report

1.	Double-Click on the image of the object in your report (or on the icon if an icon is used to represent the object).

2.	Crystal Reports opens the object application displaying the object data if the object is embedded, or the original file if the object is linked to a file.

3.	Make any changes necessary using the tools and commands available in the object application.


Editing an OLE object 2
 Editing an OLE object
in your report

4.	Save your changes according to the following:

If the object is embedded in your report, select File|Update. The embedded object will be updated in your report.

If the object is linked to another file, select File|Save to save the changes in the original file.


Editing an OLE object 3
 Editing an OLE object
in your report

5.	Exit the object application by selecting File|Exit or File|Exit & Return to Report. The object application closes, and you are returned to the Report Designer. The changes you made will now be reflected by the object in your report.